<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<script type="text/javascript" src="../public/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../public/lib/jquery/1.9.1/jquery.min.js"></script>
<#include "lib/lib.html" />
<title>修改套餐</title>
</head>
<body>
<div class="pd-20">
	<form action="${basePath}/pageage/updatePageage.do" method="post"  class="form form-horizontal" id="form-area-edit" enctype="multipart/form-data">
		<input type="hidden" name="id" value="${pageage.id!}" />
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>服务分类：</label>
			<div class="formControls col-5"> <span class="select-box" >
				<select class="select" id="classicId" name="classicId" nullmsg="请选择">
					<#if list?? && list?size gt 0>
						<#list list as dl >
							<option value="${dl.id}" <#if dl.id == pageage.classicId>selected="selected"</#if>>${dl.classicName}</option>
						</#list>
					</#if>
				</select>
			</span> 
			</div>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>套餐名称：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${pageage.pageageName!}" placeholder="" id="pageageName" name="pageageName" datatype="*2-60" nullmsg="套餐名称不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">套餐图片：</label>
			<div class="formControls col-5">
				<span class="btn-upload">
				  <a href="javascript:void();" class="btn btn-primary radius"><i class="iconfont">&#xf0020;</i> 浏览文件</a>
				 <input type="file" multiple name="file" class="input-file" accept="image/png,image/jpg,image/jpeg,imge/bmp,image/gif">
				 </span>
				 <img alt="" src="${pageage.pageageImages!}" width="160" height="160">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">套餐时长：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${pageage.pageageTimes!}" id="pageageTimes" name="pageageTimes" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>套餐价格：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${pageage.pageagePrice / 100!}" id="pageagePrice" name="pageagePrice" datatype="*1-60" nullmsg="价格不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">可使用次数：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="${pageage.usedCount!}" id="usedCount" name="usedCount" >
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">套餐有效时间：</label>
			<div class="formControls col-5">
				<input type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="effectiveTime" value="${pageage.effectiveTime?string('yyyy-MM-dd')!}" name="serviceStart" class="input-text Wdate" style="width:180px;">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">套餐描述：</label>
			<div class="formControls col-5">
				<textarea rows="8" cols="45" id="pageageDesc" name="pageageDesc">${pageage.pageageDesc!}</textarea>
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<button type="button" onclick="submitBtn()" class="btn btn-success radius" id="admin-role-save" name="admin-role-save">
						<i class="icon-ok"></i> 确定
				</button>
				<button type="button" onclick="layer_close()" class="btn btn-success radius" id="admin-role-close"
						name="admin-role-close">
						<i class="icon-ok"></i>取消
					</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
function submitBtn(){
	var classicId = $("#classicId").val();
	if(classicId == ""){
		layer.msg('请选择服务分类', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	var pageageName = $("#pageageName").val();
	if(pageageName == null || pageageName == ""){
		layer.msg('套餐名称不能为空', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	var pageagePrice = $("#pageagePrice").val();
	if(pageagePrice == null || pageagePrice == ""){
		layer.msg('套餐价格不能为空', {
			icon : 1,
			time : 1000
		});
		return ;
	}
	$("#form-area-edit").ajaxForm({
		success:function(data) {
			if(data == 200){
				layer.msg('添加成功!', {icon: 6,time:1000});
				window.parent.location.href="${basePath}/pageage/list.do";
			}else{
				layer.msg(data.data, {icon: 5,time:1000});
			}
		},      
		dataType:"json"   
	}).submit(); 	
}
</script>
</body>
</html>